import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    component: () => import('@/views/Login')
  },
  {
    path: '/index',
    component: () => import('@/views/Index'),
	children:[
	  {
		path:'/index',
		redirect:'/wel'  
	  },
	  {
		path:'/wel',
		component:()=>import ('@/components/Welcome'),	
	  },
      { 
        path:'/users',
        component:()=>import ('@/components/user/users'),
      },
      {  
        path:'/roles',
        component:()=>import ('@/components/power/roles'),
      },
      {
        path:'/rights',
        component:()=>import ('@/components/power/rights'),
      },
      {
        path:'/orders',
        component:()=>import ('@/components/orders/Order'),
      },
      {
        path:'/categories',
        component:()=>import ('@/components/shop/Cate.vue'),
      },
      {
        path:'/goods',
        component:()=>import ('@/components/shop/Goods.vue'),
      },
	  {
        path:'/goods/add',
        component:()=>import ('@/components/shop/add.vue'),
      },
      {
        path:'/params',
        component:()=>import ('@/components/shop/Params.vue'),
      },
	  {
        path:'/reports',
        component:()=>import ('@/components/report/Reports.vue'),
      }
    ]
  },
  {
	  path:'/',
	  redirect:'/login'
  }
]

const router = new VueRouter({
	mode:'history',
	base:process.env.BASE_URL,
	routes
})

export default router
